﻿using System;
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace Huasky.Gm.Database.Migrations.Migrations
{
    /// <inheritdoc />
    public partial class init : Migration
    {
        /// <inheritdoc />
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.CreateTable(
                name: "FaultRecord",
                columns: table => new
                {
                    Id = table.Column<Guid>(type: "TEXT", nullable: false),
                    Code = table.Column<string>(type: "TEXT", nullable: true),
                    Phenomenon = table.Column<string>(type: "TEXT", nullable: true),
                    Responsibility = table.Column<string>(type: "TEXT", nullable: true),
                    Result = table.Column<string>(type: "TEXT", nullable: true),
                    CreatedTime = table.Column<DateTimeOffset>(type: "TEXT", nullable: false),
                    UpdatedTime = table.Column<DateTimeOffset>(type: "TEXT", nullable: true),
                    ExtJson = table.Column<string>(type: "TEXT", nullable: true),
                    IsDelete = table.Column<bool>(type: "INTEGER", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_FaultRecord", x => x.Id);
                });

            migrationBuilder.CreateIndex(
                name: "IX_FaultRecord_Code",
                table: "FaultRecord",
                column: "Code");

            migrationBuilder.CreateIndex(
                name: "IX_FaultRecord_CreatedTime",
                table: "FaultRecord",
                column: "CreatedTime");

            migrationBuilder.CreateIndex(
                name: "IX_FaultRecord_Phenomenon",
                table: "FaultRecord",
                column: "Phenomenon");

            migrationBuilder.CreateIndex(
                name: "IX_FaultRecord_UpdatedTime",
                table: "FaultRecord",
                column: "UpdatedTime");
        }

        /// <inheritdoc />
        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropTable(
                name: "FaultRecord");
        }
    }
}
